package com.example.demo.util;

import com.alibaba.fastjson.JSON;

/**
 * 对象序列化,JSON和对象之间的转换
 * @author mrc
 */
public class ObjectSerialization {


    private ObjectSerialization() {
    }

    public static String serialization(Object object) {
        return JSON.toJSONString(object);
    }

    public static <T> T deSerialization(String object, Class<T> tClass) {
        return JSON.parseObject(object, tClass);
    }
}
